package com.example.campuslink.viewModel

import android.content.Intent
import androidx.lifecycle.MutableLiveData
import com.example.campuslink.commen.tools.putExtraKey
import com.example.campuslink.ui.activity.PublicActivity
import com.example.campuslink.ui.activity.WordEditActivity

class WordEditViewModel : BaseViewModel() {
    private val _wordSize = MutableLiveData<Int>()
    val wordSize get() = _wordSize

    fun setWordSize(size: Int) {
        _wordSize.value = size
    }

    fun jumpToWordEditActivity(word: String) {
        startActivity(
            Intent().apply { putExtra(putExtraKey.WORD.key, word) },
            targetClass = WordEditActivity::class.java
        )
    }


    private val _editWord = MutableLiveData<String>()
    val editWord get() = _editWord
    fun setEditWord(word: String) {
        _editWord.value = word
    }

    private val _editWordSize = MutableLiveData<Int>()
    val editWordSize get() = _editWordSize
    fun setEditWordSize(size: Int) {
        _editWordSize.value = size
    }

    fun jumpToInvitationPublicActivity(imagePath: String) {
        startActivity(
            Intent().apply {
                putExtra(putExtraKey.IMAGE_PATH.key, imagePath)
                putExtra(putExtraKey.ISFROM_PHOTO.key, false)
            },
            targetClass = PublicActivity::class.java
        )
    }
}